From 1e83689c992930e302c6bb081059bc7726054ef0 Mon Sep 17 00:00:00 2001 From: Eli Zaretskii Date: Fri, 23 Jul 2004 11:52:03 +0000 Subject: [PATCH] (completion-setup-function): Compute the common parts and the first difference place correctly when partial-completion-mode is on. --- lisp/simple.el | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/lisp/simple.el b/lisp/simple.el index 9d61a390575..1e112b1be74 100644 --- a/lisp/simple.el +++ b/lisp/simple.el @@ -4313,6 +4313,13 @@ of the differing parts is, by contrast, slightly highlighted." (if minibuffer-completing-file-name (with-current-buffer mainbuf (setq default-directory (file-name-directory mbuf-contents)))) + ;; If partial-completion-mode is on, point might not be after the + ;; last character in the minibuffer. + ;; FIXME: This still doesn't work if the text to be completed + ;; starts with a `-'. + (when (and partial-completion-mode (not (eobp))) + (setq mbuf-contents + (substring mbuf-contents 0 (- (point) (point-max))))) (with-current-buffer standard-output (completion-list-mode) (make-local-variable 'completion-reference-buffer) -- 2.30.2